package com.shiguiwu.springmybatis.spring.lifecycle.allbeaninit;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @description: 10所有bean初始化完成
 * 注意是非懒加载的bean初始化完成
 * @author: stone
 * @date: Created by 2021/3/28 13:35
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.lifecycle.allbeaninit
 */
@ComponentScan
public class AllBeanInitTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
//        Arrays.stream(context.getBeanDefinitionNames()).forEach(b -> System.out.println(context.getBean(b)));
        context.register(AllBeanInitTests.class);
        System.out.println("开始启动容器!");
        context.refresh();
        System.out.println("容器启动完毕!");
    }


}
